/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
}

/* 头部导航栏 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #666;
    text-decoration: none;
    font-size: 16px;
}

.nav-links a:hover {
    color: #ff4d4f;
}

/* 主要内容区 */
.main {
    max-width: 1200px;
    margin: 80px auto 20px;
    padding: 0 20px;
}

/* 商家列表 */
.merchant-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.merchant-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.merchant-card:hover {
    transform: translateY(-5px);
}

.merchant-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.merchant-info {
    padding: 15px;
}

.merchant-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.merchant-rating {
    color: #ff4d4f;
    margin-bottom: 5px;
}

.merchant-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 搜索框 */
.search-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* 分类标签 */
.category-tags {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.category-tag {
    padding: 5px 15px;
    background: #f0f0f0;
    border-radius: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.category-tag:hover {
    background: #ff4d4f;
    color: #fff;
}

/* 底部 */
.footer {
    background: #333;
    color: #fff;
    padding: 20px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* 注册页面样式 */
.register-form {
    max-width: 500px;
    margin: 100px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.register-form h1 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.register-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #333;
}

.register-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.register-form button {
    width: 100%;
    padding: 10px;
    background-color: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.register-form button:hover {
    background-color: #e04344;
}

/* 我的订单页面样式 */
.orders-list {
    max-width: 800px;
    margin: 100px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.orders-list h1 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.order-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.order-item p {
    font-size: 14px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .merchant-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .nav {
        height: auto;
        padding: 10px 20px;
        flex-direction: column;
    }
    
    .nav-links {
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .main {
        padding: 10px;
    }
    .register-form, .orders-list, .profile-container {
        width: 100%;
        padding: 10px;
    }
    .nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* 表单加载指示器样式 */
.form-loading {
    position: relative;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
    border-top: 3px solid #ff4d4f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
